#pragma once
#ifndef MESH_HPP
#define MESH_HPP

#include <vector>
#include <glm/glm.hpp>

#include "Vertex.hpp"
#include "gl/BO.hpp"

class Mesh
{
public:
    uint32_t vao = 0;
    VBO vbo;
    IBO ibo;
    size_t indices_size;
    Mesh(std::vector<Vertex> vertices, std::vector<uint32_t> indices);
    inline void draw() const
    {
        glBindVertexArray(vao);
        glDrawElements(GL_TRIANGLES, static_cast<uint32_t>(indices_size), GL_UNSIGNED_INT, 0);
    };
    ~Mesh();
private:
    void setup(std::vector<Vertex> vertices, std::vector<uint32_t> indices);
};
#endif // MESH_HPP
